package day1105.demo01;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/5 9:42
 */

public class Test {


    public static void main(String[] args) {
        List<Wql> list = new ArrayList<>();

        list.add(new Wql("张一",12));
        list.add(new Wql("张二",13));
        list.add(new Wql("张三",14));
        list.add(new Wql("张四",15));
       // list.stream().filter(item->item.getAge()>12).forEach(System.out::println);
        list.stream().map(item->item.getAge()==13).forEach(System.out::println);

    }
}
class Wql{
    private String name;
    private Integer age;

    public Wql(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Wql{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
